import request from '@/utils/request'

// api地址
const api = {
  userInfo: '/store/users/info',
  userMenus: '/store/menu/current-user-tree',
  modify: '/store/users/modify'
}

// 当前登录的用户信息
export const userInfo = (param, option) => {
  const options = {
    isPrompt: true, //（默认 true 说明：本接口抛出的错误是否提示）
    load: false, //（默认 true 说明：本接口是否提示加载动画）
    ...option
  }
  return request.get(api.userInfo, param, options)
}

// 获取用户菜单
export const userMenus = () => {
  return request.get(api.userMenus, {}, { load: false })
}

/**
 * 修改密码
 * */
export const userModify = (param, option) => {
  return request.post(api.modify, param, option)
}
